﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.Breeding.Infrastructure.Migrations
{
    public partial class 育种实体层 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BodyMeasure",
                columns: table => new
                {
                    BMID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MeasureDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Earbugles = table.Column<int>(type: "int", nullable: false),
                    Height = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Bust = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Scrotum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    EyeArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BodyLength = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TubeGirth = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Backfat = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    EyeWidth = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BodyMeasure", x => x.BMID);
                });

            migrationBuilder.CreateTable(
                name: "ConditionMeasure",
                columns: table => new
                {
                    CMID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MeasureDate = table.Column<int>(type: "int", nullable: false),
                    Earbugles = table.Column<int>(type: "int", nullable: false),
                    ToothType = table.Column<int>(type: "int", nullable: true),
                    Stain = table.Column<int>(type: "int", nullable: true),
                    MouthColor = table.Column<int>(type: "int", nullable: true),
                    FatFound = table.Column<int>(type: "int", nullable: true),
                    Hairs = table.Column<int>(type: "int", nullable: true),
                    HoofColor = table.Column<int>(type: "int", nullable: true),
                    Angle = table.Column<int>(type: "int", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ConditionMeasure", x => x.CMID);
                });

            migrationBuilder.CreateTable(
                name: "SheepWeigh",
                columns: table => new
                {
                    SwID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WeighDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Earbugles = table.Column<int>(type: "int", nullable: true),
                    Breed = table.Column<int>(type: "int", nullable: true),
                    Sex = table.Column<bool>(type: "bit", nullable: false),
                    WeighMonth = table.Column<int>(type: "int", nullable: true),
                    WeightType = table.Column<int>(type: "int", nullable: true),
                    WeightKg = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepWeigh", x => x.SwID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BodyMeasure");

            migrationBuilder.DropTable(
                name: "ConditionMeasure");

            migrationBuilder.DropTable(
                name: "SheepWeigh");
        }
    }
}
